package com.yqd.d3_abstract.demo1;

public class GoldCard extends Card {
    public GoldCard() {
    }

    public GoldCard(String userName, Double balance) {
        super(userName, balance);
    }

    @Override
    public void pay(Double money) {
        System.out.println("=====皇上皇：支付系统======");
        System.out.println("您的卡片当前余额：" + getBalance() + "元");
        System.out.println("您当前消费" + money + "元");
        System.out.println("您的卡片等级为金卡，享受8折优惠");
        double realMoney = money * 0.8;
        setBalance(getBalance()-realMoney);
        System.out.println(getUserName() + ":优惠后，本次实际消费:" + realMoney + "消费后，账户余额为:" + getBalance());
    }
}
